﻿using System;
using System.ComponentModel;
using System.Linq;
using ProjectEuler.Linq;

namespace ProjectEuler.Problems
{
    [EulerProblem(36, 872187L)]
    [Description("Find the sum of all numbers less than one million, which are palindromic in base 10 and base 2.")]
    internal sealed class Problem036 : EulerProblem
    {
        public override Object Solve()
        {
            return (1L).To(999999L, 2).Where(n => n.IsPalindrome(2) && n.IsPalindrome(10)).Sum();
        }
    }
}
